package tools;

public class Tools {
	private double r;
	private double h;
	private double l;
	private double pi=3.1415;
	private double volume;
	private double area;
	public Tools(double r){
		this.r=r;
	}
	public Tools(double r,double h){
		this.r=r;
		this.h=h;
	}
	public Tools(){
		
	}
	public double getR() {
		return r;
	}
	public void setR(double r) {
		this.r = r;
	}
	public double getH() {
		return h;
	}
	public void setH(double h) {
		this.h = h;
	}
	public double getPi() {
		return pi;
	}
	public void setPi(double pi) {
		this.pi = pi;
	}
	public double getL() {
		return l;
	}
	public void setL(double l) {
		this.l = l;
	}
	public double ballArea(double r){
		area=4*r*r*r*pi;
		String a = String.format("%.2f",area);
		double area = Double.parseDouble(a);
		return area;	
	}
	public double ballVolume(double r){
		volume=pi*r*r*r*4/3;
		String v = String.format("%.2f",volume);
		double volume = Double.parseDouble(v);
		return volume;
	}
	public double cylinderArea(double r,double h){
		area=r*r*pi+r*r*pi+2*r*pi*h;
		String a = String.format("%.2f",area);
		double area = Double.parseDouble(a);
		return area;	
	}
	public double cylinderVolume(double r,double h){
		volume=pi*r*r*h;
		String v = String.format("%.2f",volume);
		double volume = Double.parseDouble(v);
		return volume;
	}
	public double coneArea(double r,double l){
		area=pi*r*l+r*r*pi;
		String a = String.format("%.2f",area);
		double area = Double.parseDouble(a);
		return area;
	}
	public double coneVolume(double r,double l){
		volume=pi*r*r*l*1/3;
		String v = String.format("%.2f",volume);
		double volume = Double.parseDouble(v);
		return volume;
	}

}